package datasv.framework_datasv;

import java.util.ArrayList;
import java.util.List;

import data.datafactory.DatabaseOperator;
import po.ModelPO;

public class GetCollegeModel {
	public static void main(String[] args) {
		System.out.println(new GetCollegeModel().getCollegeModel("000"));
		
	}
	public List<ModelPO> getCollegeModel(String collegeID){
		return getInSql(collegeID);
	}
	private List<ModelPO> getInSql(String collegeID){
		DatabaseOperator op=new DatabaseOperator("college");
		ArrayList<ModelPO> list=new ArrayList<ModelPO>();
		if(!op.ifIDExist("college_list",collegeID)){
			return list;
		}
		ArrayList<String> id =op.getColumn("plan_model_list", "id");
		for (int i = 0; i < id.size(); i++) {
			if(id.get(i).substring(0,3).equals(collegeID)){
				ModelPO m=new GetModel().getModel(collegeID, id.get(i));
				if(m!=null){
					list.add(m);
				}
			}
		}
		return list;
	}
}
